{% extends "backend/backendbase.html" %} 
{% block tittle %}Edit Category{% endblock %} 
{% block category_selected %}class="current"{% endblock %} 
{% block table_content %}

<div id="table-content">
							<form action="" method="post" id="addcategory">
								{% csrf_token %}
								<!-- start id-form -->
								<table align="center" border="0" cellpadding="0" cellspacing="0"
									id="id-form">
									<tr>
										<th valign="top">Category name:</th>
										<td><input type="text" class="inp-form" name="name"
											value="{{var_category_edit}}" />
										</td>
										<td>
											<div class="error-left"></div>
											<div class="error-inner"></div></td>
									</tr>
									<tr>
										<th valign="top">Category weight:</th>
										<td><input type="text" class="inp-form" name="weight"
											value="{{var_weight_edit}}" />
										</td>
										<td>
											<div class="error-left"></div>
											<div class="error-inner"></div></td>
									</tr>
									<tr>
										<th valign="top">Category status:</th>
										<td><input type="text" class="inp-form" name="status"
											value="{{var_status_edit}}" />
										</td>
										<td>
											<div class="error-left"></div>
											<div class="error-inner"></div></td>
									<tr>
										<td></td>
									</tr>
									<tr>
										<th>&nbsp;</th>
										<td valign="top"><input type="submit" value=""
											class="form-submit" name="submit" /> <input type="reset"
											value="" class="form-reset" name="reset" /></td>
										<td></td>
									</tr>
									
									
									
									
								</table>
							
									{{var_check}}
									
							</form>
							<script>
								$(document)
										.ready(
												function() {
													$(".error-inner")
															.each(
																	function() {
																		if ($(
																				this)
																				.html() == '') {
																			$(
																					this)
																					.css(
																							"visibility",
																							"hidden");
																			$(
																					this)
																					.siblings(
																							".error-left")
																					.css(
																							"visibility",
																							"hidden");
																		}
																	});

												});
								$(document)
										.ready(
												function() {
													$("#addcategory")
															.validate(
																	{
																		rules : {
																			name : {
																				required : true
																			},
																			weight : {
																				required : true,
																				digits : true
																			},
																			status : {
																				required : true,
																				digits : true
																			}
																		},
																		errorPlacement : function(
																				error,
																				element) {
																			$(
																					element)
																					.parent()
																					.next()
																					.children(
																							".error-inner")
																					.html(
																							error);
																		},
																		//errorClass: "",
																		highlight : function(
																				element,
																				errorClass) {
																			$(
																					element)
																					.parent()
																					.next()
																					.children(
																							".error-left, .error-inner")
																					.css(
																							"visibility",
																							"visible");
																			$(
																					element)
																					.removeClass(
																							"inp-form");

																			$(
																					element)
																					.addClass(
																							"inp-form-error");

																		},

																		unhighlight : function(
																				element,
																				errorClass) {

																			$(
																					element)
																					.parent()
																					.next()
																					.children(
																							".error-left, .error-inner")
																					.css(
																							"visibility",
																							"hidden");

																			$(
																					element)
																					.removeClass(
																							"inp-form-error");

																			$(
																					element)
																					.addClass(
																							"inp-form");

																		},
																	});
												});
							</script>
						</div>
						<!--  end table-content  -->
						<div class="clear"></div>
					</div> <!--  end content-table-inner  --></td>
{% endblock %}
